package com.itheima.controller;

import com.itheima.service.db.BlackListService;
import com.itheima.vo.PageBeanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/blackList")
public class BlackListController{

    @Autowired
    private BlackListService blackListService;

    @GetMapping("/findBlackUserByUserId")
    public PageBeanVo findBlackUserByUserId(Long userId, Integer pageNum, Integer pageSize) {
        return blackListService.findBlackUserByUserId(userId, pageNum, pageSize);
    }

    @DeleteMapping("/deleteBlackUser")
    public void deleteBlackUser(Long userId, Integer blackUserId) {
        blackListService.deleteBlackUser(userId, blackUserId);
    }
}
